//@Description: 定义路由的相关问文件

package routes

import (
	"github.com/gin-gonic/gin"
	"pingbuqingyun_django/app/controller"
	"pingbuqingyun_django/middlewares"
)

func RegisterRouter() *gin.Engine {
	Router := gin.New()
	// 基本中间件使用
	Router.Use(middlewares.PaginationMiddleware())

	// use cors
	Router.Use(middlewares.CorsMiddleWare())
	naRouter := Router.Group("/api/v1/na")
	controller.InitNaRouter(naRouter)

	Router.Use(middlewares.JwtAuth())
	adminRouter := Router.Group("/api/v1/cms")
	controller.InitAdminRouter(adminRouter)

	//Router.GET("/debug/pprof/*name", gin.WrapF(pprof.Handler))
	return Router
}
